package com.karry.yl.domain.system;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.karry.commons.base.SuperEntity;

@TableName("jg_user")
public class User extends SuperEntity {
    public static final int STATUS_ACTIVE = 1;
    public static final int STATUS_DISABLE = 0;

    private String userName;

    private String password;

    private String phone;  //手机号

    private String email;  //邮箱

    private int status;  //0: 正常   1：冻结

    private Long roleId;  //角色ID

    @JsonSerialize(using= ToStringSerializer.class)
    private Long orgId; // 机构ID

    private Boolean primary;  //是否是主账号

    private String userCode;

    @TableField(exist = false)  //表示该属性不为数据库表字段，但又是必须使用的。
    private Role role;  //角色，查询时封装数据

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public Boolean getPrimary() {
        return primary;
    }

    public void setPrimary(Boolean primary) {
        this.primary = primary;
    }
}
